//导入
import { createStore, applyMiddleware } from "redux"
import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension';
import rootReducer from "./reducer";

//创建仓库
const store = createStore(rootReducer,
  composeWithDevTools(applyMiddleware(thunk)))

export type AppDispatch = typeof store.dispatch
export type RootState = ReturnType<typeof store.getState>
//默认导出
export default store
